﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;

namespace PEAnalyzer.ValueConvert.MainPage
{ 
    public class SuggestGridVisibleValueConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            int pData = (int)value;
            bool bNeedStatus = System.Convert.ToBoolean(parameter);
            Visibility visibility = Visibility.Collapsed;
            if(bNeedStatus == true && pData == 0)
            {
                visibility = Visibility.Visible;
            }
            else if(bNeedStatus == false & pData != 0)
            {
                visibility = Visibility.Visible;
            }
            return visibility;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
